package com.webchat.netty.server.common;

import com.webchat.common.util.IPAddressUtil;
import com.webchat.common.util.MD5Utils;
import com.webchat.netty.server.config.properties.NettyServerProperties;

public class NettyInstanceUtils {

    /**
     * 获取当前Netty Server 节点实例信息
     * IP:PORT
     *
     * @return
     */
    public static String getInstanceId() {
        return IPAddressUtil.getLocalIPv4Address() + ":" + NettyServerProperties.PORT;
    }

    public static String getInstanceMd5() {
        return MD5Utils.md5(getInstanceId());
    }
}
